﻿using System;
class SortingIntegers
{
    static void Main()
    {
        int numberone = 0;
        int numbertwo = 0;
        int numberthree = 0;
        Console.WriteLine("Please enter three integers: ");
        while (true)
        {
            try
            {
                numberone = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter first number:");
            }
        }
        while (true)
        {
            try
            {
                numbertwo = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter second number:");
            }
        }
        while (true)
        {
            try
            {
                numberthree = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter third number:");
            }
        }
        Console.WriteLine("{0}, {1}, {2}", numberone, numbertwo, numberthree);
        Console.ReadLine();

        if (numberone > numbertwo)
        {
            if (numbertwo > numberthree)
            {
                Console.WriteLine("Sorted numbers: {0}, {1}, {2}", numberone, numbertwo, numberthree);
            }
            else
            {
                if (numberone > numberthree)
                {
                    Console.WriteLine("Sorted numbers: {0}, {1}, {2}", numberone, numberthree, numbertwo);
                }
                else
                {
                    Console.WriteLine("Sorted numbers: {0}, {1}, {2}", numberthree, numberone, numbertwo);
                }
            }
        }
        else
        {
            if (numbertwo < numberthree)
            {
                Console.WriteLine("Sorted numbers: {0}, {1}, {2}", numberthree, numbertwo, numberone);
            }
            else
            {
                if (numberone > numberthree)
                {
                    Console.WriteLine("Sorted numbers: {0}, {1}, {2}", numbertwo, numberone, numberthree);
                }
                else
                {
                    Console.WriteLine("Sorted numbers: {0}, {1}, {2}", numbertwo, numberthree, numberone);
                }
            }
        }
        Console.ReadLine();
    }
}

